using ServerNET.Server;

namespace ServerNET.Logic
{
    public class CGameLogic
    {
        protected CTable Table;

	    // Constructor
	    public CGameLogic(CTable Table)
        {
            this.Table = Table;
        }

	    // Called when receive packet
        public virtual void OnReceive(CClient Connection, CPacket Packet)
        {
        }

	    // Called sequense 1 second
        public virtual void OnTimer() 
        {
        }

        // Kiểm tra người chơi vào được bàn chơi không
        public virtual bool CanJoinTable(CClient Client)
        {
            return true;
        }

	    // Start Logic Game
	    // Called when user request start game
        public virtual void StartGame()
        {
        }

	    // This funtion called when:
	    // - The game finish
	    // - Player exit game and have 1 player in game
        public virtual void EndGame()
        {
        }

	    // Called when player exit game while the game playing
        public virtual void OnClientExit(CClient Client)
        {
        }

	    // Send Game Data to Viewer
        public virtual void SendViewerData(CClient Viewer)
        {
        }
    }
}
